<?php

/**
 * 
 * @author littlexiang
 * @version $Id: Context.php 685 2009-08-03 06:28:25Z songxiang $
 */
class Context {
    static $paramHolder;
    
    public static function set ($key, $value = '') {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                self::set($k, $v);
            }
        } else {
            self::$paramHolder[$key] = $value;
        }
    }
    
    public static function get ($key = '') {
        if (!empty($key)){
            return self::$paramHolder[$key];
        }else{
            return self::$paramHolder;
        }
    }
    
    public static function setParams ($array) {
        self::$paramHolder['params'] = $array;
    }
    
    public static function setParam ($key, $value) {
        self::$paramHolder['params'][$key] = $value;
    }
    /**
     * @param string $key
     * 
     * @return string
     */
    public static function getParam ($key) {
        return self::$paramHolder['params'][$key];
    }
    /**
     * 
     * @return array
     */
    public static function getParams () {
        return self::$paramHolder['params'];
    }
}
?>